<template>
  <div class="table-choose">
    <p class="title">{{ table.title }}</p>
    <van-radio-group v-model="radio" direction="horizontal">
      <van-radio
        :name="item.value"
        v-for="(item, index) of table.content"
        :key="index"
        >{{ item.name }}</van-radio
      >
    </van-radio-group>
  </div>
</template>

<script>
export default {
  props: {
    table: {
      type: Object,
      default: () => ({content:[{}]}),
    },
    vcPrintTypeId: { type: String, default: "" },
  },
  data() {
    return {
      radio: "",
    };
  },
  created(){
    this.radio = this.table.content[0].value
  },
  methods: {
    getParams() {
      let params = {
        [this.table.id]:this.radio
      };
      return params;
    },
  },
};
</script>

<style lang="scss" scoped>
@import "@/assets/styles/variable.scss";
.table-choose {
  padding: 0.266667rem /* 10/37.5 */;
  max-height: 10rem;
  overflow: scroll;
  border: 1px solid #eee;
  border-radius: 0.266667rem /* 10/37.5 */;
  margin:.266667rem /* 10/37.5 */;
  .title {
    margin-bottom: 0.266667rem /* 10/37.5 */;
    font-size: 0.313333rem+$fontsize /* 14/37.5 */;
    color: #111;
  }
  .table {
    border-collapse: collapse;
    tr {
      transition: all 0.3s linear;
      &.active {
        background: $primary;
        color: #fff;
      }
      &.disable {
        background: #ececec;
        color: #111;
      }
    }
    th,
    td {
      min-width: 2.666667rem /* 100/37.5 */;
      text-align: center;
      padding: 0.266667rem /* 10/37.5 */;
    }
  }

  // text overflow 文字溢出显示省略号
  .text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    // 设置文本不能换行
    white-space: nowrap;
  }
}
</style>
